######################################
#
######################################
#source file
SOURCE  := $(wildcard *.c) $(wildcard *.cpp)
OBJS    := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))


TARGET  := testvec testpoly testspline testBspline testBFormspline \
testKnotsHelper testCardinalBspline


#compile and lib parameter

CC      := gcc
CXX     := g++
LIBS    :=
LDFLAGS := -lcblas -lrefblas -llapacke -llapack -lgfortran
DEFINES :=
INCLUDE := -I ../include
CFLAGS  := -g -Wall -O3 $(DEFINES) $(INCLUDE)
CXXFLAGS:= $(CFLAGS)


.PHONY : objs clean

all : $(TARGET)

objs : $(OBJS)

clean :
	rm -fr *.so
	rm -fr *.o
	rm -fr $(TARGET)
testvec:
	$(CXX) $(CXXFLAGS) -o $@ testvec.cpp 
testpoly:
	$(CXX) $(CXXFLAGS) -o $@ testpoly.cpp 
testspline:
	$(CXX) $(CXXFLAGS) -o $@ testspline.cpp $(LDFLAGS)
testBspline:
	$(CXX) $(CXXFLAGS) -o $@ testBspline.cpp
testBFormspline:
	$(CXX) $(CXXFLAGS) -o $@ testBFormspline.cpp $(LDFLAGS)
testKnotsHelper:
	$(CXX) $(CXXFLAGS) -o $@ testKnotsHelper.cpp
testCardinalBspline:
	$(CXX) $(CXXFLAGS) -o $@ testCardinalBspline.cpp $(LDFLAGS)
